package com.wft.chapter06.enumtest;

public enum Operation {
    PLUS {
        public double eval(double x, double y) {
            return x + y;
        }
    },
    MINUS {
        public double eval(double x, double y) {
            return x - y;
        }
    },
    TIMES {
        public double eval(double x, double y) {
            return x * y;
        }
    },
    DIVIDE {
        public double eval(double x, double y) {
            return x / y;
        }
    };

    abstract double eval(double x,double y);

    public static void main(String[] args) {
        System.out.println(Operation.PLUS.eval(1,2));
    }
}
